package com.linyaonan.leetcode.easy._908;

import java.util.Arrays;

/**
 * @author: Lin
 * @date: 2020/1/12
 */
public class SmallestRangeI {

    public int smallestRangeI(int[] A, int K) {
        Arrays.sort(A);
        return Math.max(0, (A[A.length - 1] - A[0] - 2 * K));
    }
}
